package com.x.Part3_Date;

import java.util.Calendar;

/**
 * ClassName: Demo
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.04.08 2:29
 */
public class Demo1 {
    public static void main(String[] args) {

        int count=0;

        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR, 2000);
        calendar.set(Calendar.MONTH, 0);
        calendar.set(Calendar.DAY_OF_MONTH, 1);



        while(calendar.get(Calendar.YEAR)<=2020) {

            if(calendar.get(Calendar.YEAR)==2020 && calendar.get(Calendar.MONTH)==9 && calendar.get(Calendar.DAY_OF_MONTH)==2) {
                break;
            }


            if(calendar.get(Calendar.DAY_OF_WEEK) == 2 || calendar.get(Calendar.DAY_OF_MONTH) == 1) {
                count+=2;
            }else {
                count++;
            }

            calendar.add(Calendar.DATE, 1);
        }

        System.out.println(count);
    }
}
